package com.yyn.Learning.controller;

import com.yyn.R;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;

@RestController
@CrossOrigin  //解决跨域问题
@RequestMapping("/eduservice/user")
public class EduLoginController {
    @PostMapping("login")
    public R local(HttpServletRequest request){
        request.getSession().setAttribute("token","admin");
        return R.success().data("token","admin");
    }
    @GetMapping("info")
    public R info(){
        return R.success().data("roles","[admin]").data("name","admin").data("avatar","https://tse1-mm.cn.bing.net/th/id/OIP-C.KAYKgxKAoITSi_oiCYg5FwHaBt?w=326&h=80&c=7&r=0&o=5&dpr=2&pid=1.7");
    }
}
